<template>
  <div id="app">
    <div class="header">
      <div class="time">12:00</div>
      <van-nav-bar
          title=""
          left-text=""
          left-arrow
          @click-left="onClickLeft"
      />
      <div class="title">我的钱包</div>
      <div class="camera"></div>
    </div>
    <div class="wallet-balance">
      <div class="balance-label">可提现金额(元)</div>
      <div class="balance-actions">
        <div class="eye-icon"></div>
        <div class="recharge">充值</div>
        <div class="withdraw">提现</div>
      </div>
      <div class="balance-amount">0.00</div>
    </div>
    <div class="transaction-date">
      <select v-model="selectedDate">
        <option v-for="date in dates" :value="date">{{ date }}</option>
      </select>
    </div>
    <div class="transaction-summary">
      <div class="income">收入￥0.00</div>
      <div class="expense">支出￥0.00</div>
    </div>
    <div class="tab-bar">
      <div
          class="tab-item"
          :class="{ active: selectedTab === 'all' }"
          @click="selectTab('all')"
      >
        全部
      </div>
      <div
          class="tab-item"
          :class="{ active: selectedTab === 'income' }"
          @click="selectTab('income')"
      >
        收入
      </div>
      <div
          class="tab-item"
          :class="{ active: selectedTab === 'expense' }"
          @click="selectTab('expense')"
      >
        支出
      </div>
    </div>
    <div class="chart-container">
      <div class="chart">
        <div class="pie-chart"></div>
        <div class="no-data">暂无数据~</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      selectedTab: "all",
      selectedDate: "2022.8.17",
      dates: ["2022.8.17", "2022.8.18", "2022.8.19"],
    };
  },
  methods: {
    selectTab(tab) {
      this.selectedTab = tab;
    },
    onClickLeft() {
      this.$router.push("/wode");
    },
  },
};
</script>

<style scoped>
#app {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.header {
  display: flex;
  width: 100%;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid #ccc;
}
.time {
  font-size: 12px;
}
.title {
  font-size: 16px;
  font-weight: bold;
}
.camera {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: lightgray;
}
.wallet-balance {
  width: 100%;
  background-color: #6666ff;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border-radius: 10px;
  margin: 20px;
}
.balance-label {
  font-size: 14px;
  margin-bottom: 10px;
}
.balance-actions {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.eye-icon {
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  margin-right: 10px;
}
.recharge,
.withdraw {
  background-color: white;
  color: #6666ff;
  padding: 5px 10px;
  border-radius: 5px;
  margin-left: 10px;
}
.balance-amount {
  font-size: 30px;
}
.transaction-date {
  font-size: 14px;
  margin: 10px;
}
.transaction-summary {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 20px;
  margin-bottom: 20px;
}
.income,
.expense {
  font-size: 14px;
}
.tab-bar {
  display: flex;
  width: 100%;
  border-bottom: 1px solid #ccc;
}
.tab-item {
  flex: 1;
  text-align: center;
  padding: 10px;
  cursor: pointer;
}
.active {
  border-bottom: 2px solid #6666ff;
}
.chart-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.chart {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pie-chart {
  width: 100px;
  height: 100px;
  background-color: #6666ff;
  border-radius: 50%;
  margin-bottom: 10px;
}
.no-data {
  color: gray;
}
</style>